<?php

/*
 * Loader untuk Modul2 Aplikasi yang merupakan bagian yang terlepas dari inti program
 */


//CLASS APPLICATION CORE
include_once (APP_LOADER_PATH . 'hrs/lib/class.hrs.Pegawai.php');
include_once (APP_LOADER_PATH . 'hrs/setting.hrs.PatternValidation.inc.php');


//VALIDASI MENU
$tValidation = new InputValidation();

$tMenuSelected = ($_POST[menu] ? $_POST[menu] : $_GET[menu]);
$tValidation->SetInput($tMenuSelected);
$tValidation->SetPattern(pUnsignedInt);
$tMenuSelected = $tValidation->CheckValidation();

$tIsDefault = false;


/*
 * *KETENTUAN PENGATURAN LOADER APPLICATION
 * ***************************************
 * * PENOMORAN:
 *  11 - loader modul akademik
 *  12 - loader modul hrs
 *  21 - loader modul realcount
 *  99 - loader application core
 */

switch ($tMenuSelected) {



    /*
     * MODUL AKADEMIK
     */
    case 11 : {

            break;
        }
    /*
     * MODUL HRS
     */
    case 12 : {
            $myApp->SetLevelAccess(true);
            //CLASS LOADER
            //include_once (APP_LOADER_PATH . 'hrs/lib/class.Person.php');
            //APPLICATION:HRS LOADER
            $tPage = APP_LOADER_PATH . 'hrs/loader.hrs.inc.php';
            break;
        }

    /*
     * MODUL SMS GATEWAY
     */

    //20    

    /*
     * MODUL REAL COUNT
     */
    /* case 21 : {
      $myApp->SetLevelAccess(false);
      $tPage = 'home.php';
      //CLASS LOADER
      include_once (APP_LOADER_PATH . 'core/lib/class.core.Daerah.php');
      include_once (APP_LOADER_PATH . 'election/lib/class.election.Balon.php');
      include_once (APP_LOADER_PATH . 'election/lib/class.election.PemungutanSuara.php');
      include_once (APP_LOADER_PATH . 'election/lib/class.election.RevisiSuara.php');
      include_once (APP_LOADER_PATH . 'election/lib/class.election.TPS.php');
      include_once (APP_LOADER_PATH . 'election/lib/class.election.Responden.php');
      include_once (APP_LOADER_PATH . 'election/lib/class.election.KoordinatorTPS.php');
      include_once (APP_LOADER_PATH . 'election/lib/class.election.SMS.php');

      //JSCRIPT LOADER
      include_once (APP_LOADER_PATH . 'election/jscript/jscript.election.php');
      include_once (APP_LOADER_PATH . 'election/style/style.election.php');
      //STYLE LOADER
      //include_once (APP_LOADER_PATH . 'core/style/style.core.php');
      //APPLICATION:HRS LOADER
      $tPage = APP_LOADER_PATH . 'election/loader.election.inc.php';



      //ERROR MESSAGES LOADER
      include_once (APP_LOADER_PATH . 'election/setting.election.ErrorLibrary.inc.php');
      $myApp->SetErrorMessage($_ERRORS);
      break;
      } */

    case 31 : {
            $myApp->SetLevelAccess(false);
            $tPage = 'home.php';
            //CLASS LOADER
            include_once (APP_LOADER_PATH . 'amal/lib/class.amal.Donatur.php');
            include_once (APP_LOADER_PATH . 'amal/lib/class.amal.Transaksi.php');

            //JSCRIPT LOADER
            //include_once (APP_LOADER_PATH . 'election/style/style.election.php');
            //STYLE LOADER
            //include_once (APP_LOADER_PATH . 'core/style/style.core.php');
            //APPLICATION:HRS LOADER
            $tPage = APP_LOADER_PATH . 'amal/loader.amal.inc.php';


            //ERROR MESSAGES LOADER
            //include_once (APP_LOADER_PATH . 'election/setting.election.ErrorLibrary.inc.php');
            $myApp->SetErrorMessage($_ERRORS);
            break;
        }
    case 99 : {
            $myApp->SetLevelAccess(false);

            include_once (APP_LOADER_PATH . 'core/lib/class.core.Person.php');
            include_once (APP_LOADER_PATH . 'core/lib/class.core.User.php');

            $tPage = APP_LOADER_PATH . 'core/loader.core.inc.php';

            //APPLICATION:CORE LOADER
            //JSCRIPT LOADER
            include_once (APP_LOADER_PATH . 'core/jscript/jscript.core.php');
            //STYLE LOADER
            include_once (APP_LOADER_PATH . 'core/style/style.core.php');

            break;
        }

    default: {
            $myApp->SetLevelAccess(true);
            $tIsDefault = true;
            $tPage = 'home.php';
            $myApp->SetPage($tPage);

            //JSCRIPT LOADER

            $title = 'Welcome to Sistem Informasi Election';
            break;
        }
}

if ($tIsDefault === false)
    include_once($tPage);


